package com.cleaningcloud.erp.mapper;

import java.util.List;
import com.cleaningcloud.erp.domain.ErpWareOverflow;
import com.cleaningcloud.erp.domain.ErpWareOverflowDetails;
import com.cleaningcloud.erp.domain.ErpWareReportingDetails;
import com.cleaningcloud.erp.domain.vo.ErpWareOverflowVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;

/**
 * 报溢Mapper接口
 * 
 * @author cleaningcloud
 * @date 2024-12-02
 */
public interface ErpWareOverflowMapper 
{
    /**
     * 查询报溢
     * 
     * @param wareOverflowId 报溢主键
     * @return 报溢
     */
    ErpWareOverflowVo selectErpWareOverflowByWareOverflowId(Long wareOverflowId);

    /**
     * 查询报溢列表
     * 
     * @param erpWareOverflow 报溢
     * @return 报溢集合
     */
    List<ErpWareOverflowVo> selectErpWareOverflowList(ErpWareOverflow erpWareOverflow);

    /**
     * 新增报溢
     * 
     * @param erpWareOverflow 报溢
     * @return 结果
     */
    int insertErpWareOverflow(ErpWareOverflow erpWareOverflow);

    /**
     * 修改报溢
     * 
     * @param erpWareOverflow 报溢
     * @return 结果
     */
    int updateErpWareOverflow(ErpWareOverflow erpWareOverflow);

    /**
     * 删除报溢
     * 
     * @param wareOverflowId 报溢主键
     * @return 结果
     */
    int deleteErpWareOverflowByWareOverflowId(Long wareOverflowId);

    /**
     * 批量删除报溢
     * 
     * @param wareOverflowIds 需要删除的数据主键集合
     * @return 结果
     */
    int deleteErpWareOverflowByWareOverflowIds(Long[] wareOverflowIds);

    /**
     * 批量新增库存报损明细
     * @param list
     */
    void batchInsertWareOverflowDetails(@Param("list")List<ErpWareOverflowDetails> list);

    /**
     * 根据库存报损id批量删除明细
     * @param wareOverflowId
     */
    @Delete("delete from `cleaningcloud-erp`.erp_ware_overflow_details where ware_overflow_id = #{wareOverflowId}")
    void deleteWareOverflowDetailsByWareCheckId(@Param("wareOverflowId") Long wareOverflowId);
}
